{include file='public/header.html'}
{include file='public/cp_nav.html'}

<div class="container mtn">
    <div class="panel panel-default">
        <div class="panel-heading">文档管理<span class="pull-right"><a href="javascript:history.back(-1);">返回</a></span></div>
        <div class="panel-body">
            <a href="{:url('add')}" class="btn btn-primary">添加</a>
            <button type="button" class="btn btn-success" onclick="actionConfirm('启用','{:url('state?params=status-1')}');">启用</button>
            <button type="button" class="btn btn-info" onclick="actionConfirm('停用','{:url('state?params=status-0')}');">停用</button>
            <button type="button" class="btn btn-danger" onclick="actionConfirm('删除', '{:url('del')}');">删除</button>
        </div>
        <table class="table">
            <thead>
            <th width="50"><input type="checkbox" onclick="selectAll(this.checked)" /></th>
            <th>ID</th>
            <th>标题</th>
            <th>排序</th>
            <th>创建时间</th>
            <th>状态</th>
            <th>操作</th>
            </thead>
            <tbody>
            {foreach $list as $vo}
            <tr>
                <td><input type="checkbox" name="ids" value="{$vo.id}" /> </td>
                <td>{$vo.id}</td>
                <td><a href="{:url('edit',['id'=>$vo['id']])}">{$vo.title}</a></td>
                <td>{$vo.sort}</td>
                <td>{$vo.create_time|get_time_ago}</td>
                <td>
                    {if $vo['status']==1:}
                    <a href="javascript:ajaxConfirm('{:url('state?params=status-0',['ids'=>$vo['id']])}','停用',2);" class="btn btn-xs btn-success">已启用</a>
                    {else:}
                    <a href="javascript:ajaxConfirm('{:url('state?params=status-1',['ids'=>$vo['id']])}','启用',2);" class="btn btn-xs btn-default">已停用</a>
                    {/if}
                </td>
                <td>
                    <a href="{:url('edit',['id'=>$vo['id']])}" class="btn btn-xs btn-primary">编辑</a>
                    <a href="javascript:ajaxConfirm('{:url('del',['ids'=>$vo['id']])}','删除',2);" class="btn btn-xs btn-danger">删除</a>
                </td>
            </tr>
            {/foreach}
            </tbody>
        </table>
        <div class="panel-footer">{$list->pageLink()}</div>
    </div>
</div>

{include file='public/footer.html'}
</body>
</html>